Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing shuffling for annotations #131

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

august782
Copy link
Contributor

After re-examining the documentation related to getting annotations, it seems there is no language there that specifically states that the order is not guaranteed. As such, it may not be appropriate to shuffle the annotation order. This pull request simply removes the shuffling for uses of getting annotations.

If you know of where we initially found that annotation order is not guaranteed, please point it out and then we can keep the shuffling for the annotation order.

…notations do not explicitly state that order does not matter
@owolabileg
Copy link
Contributor

owolabileg commented Sep 17, 2019

Is shuffling of arrays returned by get*Annotations() causing some problem that you observed?

The specification of these methods is completely silent about the order of elements in the arrays, hence the reason why we likely considered the specification to be underdetermined in the first place. One could argue both ways.

@august782
Copy link
Contributor Author

It's not causing problems per se, but we get some tests flagged by NonDex due to annotation shuffling and want to be completely sure that it is actually a bug that's worth reporting. To be on the safe side, I think it would be best to only report those where we can confidently say order is not guaranteed based on the specification.

@owolabileg
Copy link
Contributor

So some tests assume that the order of annotations returned is fixed, and fail when NonDex shuffles the annotations?

@august782
Copy link
Contributor Author

Essentially, yes.

…well as modifying tests so they do not expect shuffling annotations
@august782
Copy link
Contributor Author

Latest commit was due to realizing that all I did was modify the committed JDK files instead of modifying the instrumentation code, so had to modify those and update tests so they don't expect annotation shuffling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants